//Copyright (c) Microsoft Corporation.  All rights reserved.

#pragma once

#include "DirectUnknown.h"
#include "WICBitmapDecoder.h"
#include "WICFormatConverter.h"
#include "WICEnums.h"

using namespace System;

namespace  Microsoft { namespace WindowsAPICodePack { namespace DirectX { namespace WindowsImagingComponent {

	/// <summary>
	/// Exposes methods used to create components for the Microsoft Windows Imaging 
	/// Component (WIC) such as decoders, encoders and pixel format converters.
	/// <para>(Also see IWICImagingFactory interface)</para>
	/// </summary>
    public ref class ImagingFactory :  public DirectUnknown
	{
	public:
		/// <summary>
		/// Creates a new ImagingFactory
		/// </summary>
		ImagingFactory();

		/// <summary>
		/// Creates a new instance of the WICBitmapDecoder class based on the given file.
		/// </summary>
		/// <param name="path">The path to the file to create or open.</param>
		/// <param name="access">The access to the file object, which can be read, write, or both. </param>
		/// <param name="options">The DecodeMetadataCacheOptions to use when creating the decoder.</param>
		/// <returns>A new Instance of the WICBitmapDecoder class.</returns>
		BitmapDecoder^ CreateDecoderFromFilename( 
			String^ path, 
			DesiredAccess access, 
			DecodeMetadataCacheOptions options );

		/// <summary>
		/// Creates a new instance of the WICBitmapDecoder class based on the given data stream.
		/// </summary>
		/// <param name="stream">A stream containing the image data to read.</param>
		/// <param name="options">The DecodeMetadataCacheOptions to use when creating the decoder.</param>
		/// <returns>A new Instance of the WICBitmapDecoder class.</returns>
        BitmapDecoder^ CreateDecoderFromStream( 
			System::IO::Stream^ stream,
            DecodeMetadataCacheOptions options );

		/// <summary>
		/// Creates a new instance of the WICFormatConverter class.
		/// </summary>
		/// <returns>A new Instance of the WICFormatConverter class.</returns>
		WICFormatConverter^ CreateFormatConverter();

	public protected :
		ImagingFactory(IUnknown* _factory) : DirectUnknown(_factory)
		{ }    
	
	};
} } } }
